<?xml version='1.0' encoding='UTF-8' ?>  
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">    
<ui:composition 
    xmlns="http://www.w3.org/1999/xhtml"  
    xmlns:ui="http://java.sun.com/jsf/facelets"  
    xmlns:h="http://java.sun.com/jsf/html"  
    template="./template_default.xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui"
    >  
    
    <ui:define name="complementTitreEtH1">
        Liste des magasins du vendeur #{managementBean.vendeur.firstName} #{managementBean.vendeur.name} 
    </ui:define>  

    <ui:define name="content">  

        <p:dataTable value="#{managementBean.listeMagasinsPourUnVendeur}" var="item" emptyMessage="No magasin found with given criteria" paginator="true" rows="10" rendered="#{managementBean.connectedAdmin}">

            <p:column headerText="actions" width="40px">  
                <h:commandLink action="#{managementBean.supprimerMagasin(item)}" >  
                    <h:graphicImage value="ressources/delete.png" alt="logoDelete" border="0" class="imgDelete"/>  
                </h:commandLink> 
                &nbsp;
            </p:column>
            
            <p:column sortBy="#{item.name}">
                <f:facet name="header">
                    <h:outputText value="nom"/>
                </f:facet>
                <h:outputText value="#{item.name}"/>
            </p:column>

            <p:column sortBy="#{item.longitude}" width="40px">
                <f:facet name="header">
                    <h:outputText value="longitude"/>
                </f:facet>
                <h:outputText value="#{item.longitude}"/>
            </p:column>
            
            <p:column sortBy="#{item.lattitude}" width="40px">
                <f:facet name="header">
                    <h:outputText value="lattitude"/>
                </f:facet>
                <h:outputText value="#{item.lattitude}"/>
            </p:column>
            
            <p:column headerText="MagasinId">  
                <f:facet name="header">
                    <h:outputText value="articles"/>
                </f:facet>
                <h:commandLink action="#{managementBean.chargerArticlesPourUnMagasin(item)}" value="Details"/> 
            </p:column>


        </p:dataTable>

        <br />

        <center>
            [
            <h:commandLink action="#{managementBean.chargerCreerMagasin()}">  
                <h:graphicImage value="ressources/plus.png" alt="logoDelete" border="0" class="imgDelete" rendered="#{managementBean.connectedAdmin}"/>  
            </h:commandLink> 
            magasin]

        </center>
    </ui:define>  

</ui:composition>  







